<?php

class service extends CI_Controller {

	function __construct() {
		parent::__construct();
		$this -> load -> model('m_service');
		$this -> load -> library('xmlrpc');
		$this -> load -> library('xmlrpcs');
	}

	function index(){
		$config['functions']['login'] = array('function' => 'service.login');
		$config['functions']['news'] = array('functions' => 'service.news');
		$this->xmlrpcs->initialize($config);
		$this->xmlrpcs->serve();
	}

	function login($request)
	{
		$param = $request->output_parameters();
		$data = $this->m_service->login($param[0], $param[1]);
		$response = array(json_encode($data));
		return $this->xmlrpc->send_response($response);
	}


}
?>